x86/NPT: deal with fallout from 2Mb/1Gb unmapping change
authorJan Beulich <jbeulich@suse.com>
Tue, 6 Jun 2017 12:32:54 +0000 (14:32 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 6 Jun 2017 12:32:54 +0000 (14:32 +0200)
commit83520cb4aa39ebeb4eb1a7cac2e85b413e75a336
tree8505d7aef259064cf75c033d3486f965d8ef0599
parentd8eed4021d50eb48ca75c8559aed95a2ad74afaa
x86/NPT: deal with fallout from 2Mb/1Gb unmapping change

Commit efa9596e9d ("x86/mm: fix incorrect unmapping of 2MB and 1GB
pages") left the NPT code untouched, as there is no explicit alignment
check matching the one in EPT code. However, the now more widespread
storing of INVALID_MFN into PTEs requires adjustments:
- calculations when shattering large pages may spill into the p2m type
  field (converting p2m_populate_on_demand to p2m_grant_map_rw) - use
  OR instead of PLUS,
- the use of plain l{2,3}e_from_pfn() in p2m_pt_set_entry() results in
  all upper (flag) bits being clobbered - introduce and use
  p2m_l{2,3}e_from_pfn(), paralleling the existing L1 variant.

Reported-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
xen/arch/x86/mm/p2m-pt.c